package com.ctgu.fcftsystem.service;

import com.ctgu.fcftsystem.dao.Sercurity_tradeDao;
import com.ctgu.fcftsystem.pojo.Sercurity_trade;
import com.ctgu.fcftsystem.pojo.Sharesholder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class Sercurity_tradeServiceImpl implements Sercurity_tradeService{
    @Autowired
    private Sercurity_tradeDao sercurity_tradeDao;

    @Override
    public List<Sercurity_trade> findByPaging(int pageCount, int pageSize) {
        return sercurity_tradeDao.findByPaging(pageCount, pageSize);
    }

    @Override
    public int addSercurity_tradeInformation(Sercurity_trade sercurity_trade) {
        return sercurity_tradeDao.addSercurity_tradeInformation(sercurity_trade);
    }

    /**
     * 根据记录人、股票的交易类型、时间等多重条件进行动态查询证券流水账记录
     * @param sercurity_trade
     * @return
     */
    @Override
    public List<Sercurity_trade> searchsercurity_tradelist(Sercurity_trade sercurity_trade) {
        return sercurity_tradeDao.searchsercurity_tradelist(sercurity_trade);
    }

    /**
     * 根据tradeId删除证券交易信息
     * @param tradeId
     * @return
     */
    @Override
    public int deleteSercurity_tradeInformation(Integer tradeId) {
        return sercurity_tradeDao.deleteSercurity_tradeInformation(tradeId);
    }

    /**
     * 维护证券交易信息
     * @param sercurity_trade
     * @return
     */
    @Override
    public int updateSercurity_tradeInformation(Sercurity_trade sercurity_trade){
        return sercurity_tradeDao.updateSercurity_tradeInformation(sercurity_trade);
    }
}
